﻿namespace DomainSerializer
{
	using DomainSerializer.Controllers;
	using DomainSerializer.Domains;
	using System;
	using System.Runtime.Serialization;

	class Program
	{
		static void Main(string[] args)
		{
			DomainXMLWriter d = new DomainXMLWriter();
			d.Serialize(new User() { FirstName = "Vasya", LastName = "Pupkin" });

			var orders = new Order[] { 
				new   Order(){ ID = "id1", UserLogin = "Name1"},
				new   Order(){ ID = "id2", UserLogin = "Name2"},
				new   Order(){ ID = "id3", UserLogin = "Name3"}
			};

			d.Serialize(orders);

			DomainXMLReader r = new DomainXMLReader();

			User user = r.Deserialize("c:\\DomainSerializer.Domains.User.xml", typeof(User)) as User;
			Order[] o = r.Deserialize("c:\\DomainSerializer.Domains.Order[].xml", typeof(Order[])) as Order[];
		}
	}
}
